﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GGH
{
    public partial class Element : Form
    {
        public string type { get { return textBox1.Text; } set { textBox1.Text=value;} }
        public string piece { get { return textBox3.Text; } set { textBox3.Text = value; } }
        public string status { get { return textBox2.Text; } set { textBox2.Text = value; } }
        public string subtype { get { return textBox4.Text; } set { textBox4.Text = value; } }
        public string Desc { get { return textBox5.Text; } set { textBox5.Text = value; } }
        public Element()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length > 0 && textBox2.Text.Length > 0 && textBox3.Text.Length > 0 && textBox4.Text.Length >0 && textBox5.Text.Length >0)
            {
                this.DialogResult = DialogResult.OK;
            }
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            
        }

        private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar);
        }

    }
}
